<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>云端博客·作品</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/product.min.css">
    <link rel="stylesheet" href="css/style.min.css">
</head>
<body>
    <section id="main">
        <div class="container">
            <ul id="prod-list">
                <li><a><img src="imgs/p01.jpg" /></a></li>
                <li><a><img src="imgs/p02.jpg" /></a></li>
                <li><a><img src="imgs/p03.jpg" /></a></li>
                <li><a><img src="imgs/p04.jpg" /></a></li>
                <li><a><img src="imgs/p05.jpg" /></a></li>
                <li><a><img src="imgs/p06.jpg" /></a></li>
                <li><a><img src="imgs/p01.jpg" /></a></li>
                <li><a><img src="imgs/p02.jpg" /></a></li>
                <li><a><img src="imgs/p03.jpg" /></a></li>
                <li><a><img src="imgs/p04.jpg" /></a></li>
                <li><a><img src="imgs/p05.jpg" /></a></li>
                <li><a><img src="imgs/p06.jpg" /></a></li>
                <li><a><img src="imgs/p01.jpg" /></a></li>
                <li><a><img src="imgs/p02.jpg" /></a></li>
                <li><a><img src="imgs/p03.jpg" /></a></li>
                <li><a><img src="imgs/p04.jpg" /></a></li>
                <li><a><img src="imgs/p05.jpg" /></a></li>
                <li><a><img src="imgs/p06.jpg" /></a></li>
            </ul>
        </div>
    </section>
    <div class="modal fade" id="showImg" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <img src="imgs/p01.jpg" />
          </div>
        </div>
    </div>
    <!-- jq脚本 -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!-- Bootstrap脚本  -->
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <!-- 瀑布流布局 -->
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/imagesloaded.pkgd.min.js"></script>
<script>
    $(function(){
        // 加载页眉
        $.get('part/header.html',function(dom){
                $('#main').before(dom);
            })
            // 加载页脚
         $.get('part/footer.html',function(dom){
                $('#main').after(dom);
            })
       var $grid = $('#prod-list').masonry({
            itemSelector: 'li',
            columnWidth:200,
            gutter:20
        })
        $grid.imagesLoaded().progress(function(){
            $grid.masonry('layout');
        });

        // 打开模态框
        $('#prod-list').on('click','a',function(){
            var url = $(this).find('img').attr('src');
            $('#showImg').find('img').attr('src',url);
            $('#showImg').modal()
        })
    })
</script>
</body>
</html>